<%-- 
    Document   : CreateManaufacturer
    Created on : 2009-3-25, 14:38:50
    Author     : LIUGeorge
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, database.*" %>
<jsp:useBean id="con" class="database.DatabaseConnection"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Create Manufacturer</title>
        <style type="text/css">
            <!--
            body {
                background-image: url(../../image/3110_background/backcolor3.jpg);
                background-repeat: repeat;
            }
            .STYLE1 {font-size: 14px}
            .STYLE2 {font-size: 16px}
            -->
        </style>
    </head>
    <body>
        <script language="javascript">
            function check()
            {
                if(document.all.textfield.value=="") {
                    alert('Please enter Manufacture Nmae!');
                    document.all.textfield.focus();
                    return false;
                }
                if(document.all.textfield.value.length > 12 || document.all.textfield.value.length < 6) {
                    alert('Manufacture Name is between 6-12');
                    document.all.textfield.focus();
                    return false;
                }
                if(document.all.textfield.value.match(/[^\w\.\/]/ig)!=null) {
                    alert('The Manufacture Name just combine by English and Number!');
                    document.all.textfield.focus();
                    return false;
                }
                if(document.all.textfield9.value=="") {
                    alert('Please enter password!');
                    document.all.textfield9.focus();
                    return false;
                }
                if(document.all.textfield9.value.length > 12 || document.all.textfield9.value.length < 6) {
                    alert('User Password is between 6-12');
                    document.all.textfield9.focus();
                    return false;
                }
                if(document.all.textfield10.value=="") {
                    alert('Please enter password again!');
                    document.all.textfield10.focus();
                    return false;
                }
                if(document.all.textfield10.value.length > 12 || document.all.textfield10.value.length < 6) {
                    alert('Manfucature Password is between 6-12');
                    document.all.textfield10.focus();
                    return false;
                }
                if(document.all.textfield9.value!=document.all.textfield10.value)
                {
                    alert('The passwords are not same. Please check your password');
                    document.all.textfield9.focus();
                    document.all.textfield10.focus();
                    return false;
                }
                if(document.all.textfield4.value=="") {
                    alert('Please enter email');
                    document.all.textfield4.focus();
                    return false;
                }
                if(document.all.textfield4.value.indexOf("@")==-1 || document.all.textfield4.value.indexOf(".")==-1) {
                    alert('Please enter email by correct format!');
                    document.all.textfield4.focus();
                    return false;
                }
            }
        </script>

        <%
        String name = request.getParameter("name");
        String password = request.getParameter("password");


        con.createConnection();

        if (name != null || password != null) {
        }

        %>
        <table width="725" border="0" bordercolor="#CCCCCC">
            <tr>
                <td width="719" align="left" valign="middle" scope="col"><span class="STYLE1">Your Location: <a href="Homepage2.html" target="_blank">Home Page</a>&gt;&gt;<a href="ManufacturerManager.jsp">Manufacturer Manager</a>&gt;&gt;Create Manufacturer</span></td>
            </tr>
        </table>
        <p>&nbsp;</p>
        <form  id="create" name="create" method="post" action="CreateMF.jsp" onsubmit= "return check();">
            <table width="591" height="300" border="0">
                <tr>
                    <td width="158" align="right" valign="middle" scope="col"><span class="STYLE2">Manufacturer Name:</span></td>
                    <td width="423" align="left" valign="middle" scope="col"><label>
                            <input name="textfield" type="text" id="textfield" value="" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2"></span>Kind:</td>
                    <td align="left" valign="middle" nowrap><p>
                            <label>
                                <input type="radio" name="RadioGroup1" value="Fitting Manufacture" id="RadioGroup1_0">
                                Fitting Manufacture
                            </label>
                            <label>
                                <input type="radio" name="RadioGroup1" value="Car manufacture" id="RadioGroup1_1">
                            Car Manufacture                     </label>
                            <br>
                        </p>
                    </td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2">Manager:</span></td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield2" id="textfield2" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2">Company Web Address:</span></td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield3" id="textfield3" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2">E-mail:</span></td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield4" id="textfield4" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2"></span>Telephone:</td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield5" id="textfield5" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle"><span class="STYLE2">Fax:</span></td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield7" id="textfield7" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle">Location:</td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield6" id="textfield6" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle">UserName:</td>
                    <td align="left" valign="middle"><label>
                            <input type="text" name="textfield8" id="textfield8" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle">Password:</td>
                    <td align="left" valign="middle"><label>
                            <input type="password" name="textfield9" id="textfield9" />
                    </label></td>
                </tr>
                <tr>
                    <td align="right" valign="middle">Confirm Password:</td>
                    <td align="left" valign="middle"><label>
                            <input type="password" name="textfield10" id="textfield10" />
                    </label></td>
                </tr>
                <tr>
                    <td colspan="2" align="center" valign="middle"><label>
                            <input type="submit" name="submit" value="Submit" />
                            <input type="reset" name="reset" value="Reset" />
                    </label></td>
                </tr>
            </table>
            <p>&nbsp;</p>
        </form>
        <p>&nbsp;</p>
    </body>
</html>
